<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>


<body>
    <button>按钮</button>
    <script>
        console.log('定时器');
        let timer1 = setInterval(function () {
            console.log('风儿甚是喧嚣');
        }, 1000);

        let timer2 = setInterval(function () {
            console.log('下雨了');
        }, 1000);

        let btn = document.querySelector('button');
        btn.addEventListener('click', function () {
            console.log('清除定时器');
            clearInterval(timer1);
        });
    </script>
</body>

</html>